import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '',
        redirect: '/home/index'
    },
    {
        path: '/test', //测试页面
        name: 'test',
        component: () => import('@/views/test/test.vue')
    },
    {
        path: '/playView', //播放页面
        name: 'playView',
        component: () => import('@/views/playView/playView.vue')
    },
    {
        path: '/songSheet', //歌单页
        name: 'songSheet',
        component: () => import('@/components/songSheet.vue')
    },
    {
        path: '/login',  //登录页面
        name: 'login',
        component: () => import('@/views/login/login.vue')
    },
    {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/home.vue'),
        children: [
            {
                path: 'index',  //首页
                name: 'index',
                component: () => import('@/views/index/index.vue')
            },
            {
                path: 'search',  //搜索页
                name: 'search',
                component: () => import('@/views/search/search.vue')
            },
            {
                path: 'singer',  //歌手页
                name: 'singer',
                component: () => import('@/views/singer/singer.vue')
            },
            {
                path: 'rankingList',
                name: 'rankingList',
                component: () => import('@/views/rankingList/rankingList.vue')
            }]
    },

]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
